Skip to content

feat: Add signature and quotes in RichHtmlEditorWebview#2811

Open
solrubado wants to merge 20 commits intomainfrom
rich-editor
Open

feat: Add signature and quotes in RichHtmlEditorWebview#2811
solrubado wants to merge 20 commits intomainfrom
rich-editor

Conversation

@solrubado
Copy link
Contributor

@solrubado solrubado commented Feb 16, 2026

@solrubado solrubado changed the title feature: Add signature and quotes in RichHtmlEditorWebview feat: Add signature and quotes in RichHtmlEditorWebview Feb 16, 2026
@LunarX LunarX self-requested a review February 20, 2026 13:30
Copy link
Contributor

@LunarX LunarX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The textfield for the redaction has a different color than the background now. Also the placeholder and my signature are not displayed at all.

Edit: Ok it looks like it's more of an issue of some of the logic not loading in time instead.

In this before:
Image

On main:
Image

Copy link
Contributor

@LunarX LunarX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if the computation of saveSnapshot and isSnapshotTheSame are correct when you open a new message, modify nothing and then leave. Because right now it saves a new draft everytime even when there are no modifications

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@github-actions github-actions bot added the dependent This MR depends on another PR label Mar 3, 2026
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

This PR/issue depends on:

@LunarX LunarX self-requested a review March 3, 2026 15:14
.onEach { isVisible -> binding.newMessagePlaceholder.isVisible = isVisible }
.launchIn(lifecycleScope)
private fun removePlaceholder() {
binding.newMessagePlaceholder.visibility = View.GONE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually prefer writing it like this:

Suggested change
binding.newMessagePlaceholder.visibility = View.GONE
binding.newMessagePlaceholder.isGone = true

if (initResult.value == null) {
initDraftAndViewModel(intent = requireActivity().intent).observe(viewLifecycleOwner) { draft ->
if (draft != null) {
val isBodyEmpty = newMessageViewModel.bodyHasPlaceholder(draft.body)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this always return true because of the user's signature?

Would it work to remove the signature and quote divs and do this computation on what's left instead?

Comment on lines +488 to +493
webViewClient = initWebViewClientAndBridge(
attachments = draft.attachments,
messageUid = "MESSAGE-" + draft.messageUid,
shouldLoadDistantResources = true,
navigateToNewMessageActivity = null
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to use a custom WebViewClient, follow the setup from the readme on how to use a custom one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependent This MR depends on another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants